require 'ViewModel.UI.ErrorBoxModel'

--1: restart
ReloadErrorTipsDic = {}
--ReloadErrorTipsDic[11301] = 1
--ReloadErrorTipsDic[12902] = 1


function ThrowExceptionCode(exceptionCode,func,...)
    local args = {...}
    local errorTipsText = 7600000+exceptionCode
    local _func = func or function(value) end
    --if ReloadErrorTipsDic[exceptionCode] == 1 then
    --    _func = function(value)
    --        restart()
    --    end
    --end
    if LanModel.GetTextByID(errorTipsText) == nil then
        ShowErrorBox(760001,exceptionCode,_func)
        print("[!!!!!ERROR!!!!!!]",string.Format(LanModel.GetTextByID(760001)..'\n( CODE: {0})',exceptionCode),debug.traceback())
    else
        ShowErrorBox(errorTipsText,exceptionCode,_func)
        print("[!!!!!ERROR!!!!!!]",string.Format(LanModel.GetTextByID(errorTipsText)..'\n( CODE: {0})',exceptionCode),debug.traceback())
    end
end